package com.grammer.thread;


import java.beans.Transient;

public class TestThreadSendMsg implements Runnable {

    public static void main(String[] args) {
        TestThreadSendMsg t = new TestThreadSendMsg();
        new Thread(t).start();
        System.out.println("Main stoped");
    }

    @Override
    public void run() {
        try {
            while (true) {
                System.out.println("** Started");

                Thread.sleep(2000);

                throw new RuntimeException("exception from thread");
            }
        } catch (RuntimeException e) {
            System.out.println("** RuntimeException from thread");
        } catch (InterruptedException e) {

        }
    }

    private void dbOperate(int a){
        if(a>0){
            System.out.println("** db操作正常");
        }else{
            System.out.println("** db操作异常");
        }
    }

}


